home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_u_z / wt_jan92.zip / SHAW.ZIP / DDE.H < prev    next >
C/C++ Source or Header  |  1991-11-04  |  1KB  |  63 lines

  1. // dde.h RHS 10/15/91
  2.  
  3.  
  4. #if !defined(DDE_H)
  5. #define DDE_H
  6.  
  7. #include"winapp.h"
  8.  
  9. extern "C" 
  10. {
  11. #include<ddeml.h>
  12. }
  13.  
  14. class DDE : WinApplication
  15.     {
  16.     static WORD conversations;
  17.     FARPROC CallBack;
  18.     DWORD filters;
  19.     WORD lasterr;
  20.  
  21. protected:
  22.     DWORD instanceID;
  23.     static BOOL DDEOK;
  24.     BOOL result;
  25.  
  26. public:
  27.     DDE(FARPROC NewCallBack, DWORD filters);
  28.     ~DDE(void);
  29.     HSZ CreateStrHandle(LPSTR str, int codepage = CP_WINANSI);
  30.     void DestroyStrHandle(HSZ hsz);
  31.     BOOL Initialize(void);
  32.     void SetCallBack(FARPROC NewCallBack);
  33.     void SetFilters(DWORD newFilters);
  34.     WORD GetLastError(void);
  35.     BOOL GetResult(void);
  36.     };
  37.  
  38. class DDEClient : public DDE
  39.     {
  40.     char *server, *topic, *item, *data;
  41.     HCONV hConv;
  42.     HSZ hServer,hTopic,hItem;
  43.     DWORD timeout;
  44.  
  45.     BOOL Connect(void);
  46.     BOOL MakeRequest(void);
  47.  
  48. public:
  49.     DDEClient(char *server, char *topic, 
  50.         FARPROC ClientCallBack, DWORD filters = APPCLASS_STANDARD);
  51.     ~DDEClient(void);
  52.     char *GetData(void);
  53.     char *GetServer(void);
  54.     char *GetTopic(void);
  55.     char *GetItem(void);
  56.     void SetTimeOut(DWORD newtimeout);
  57.     WORD Request(char *item);
  58.     };
  59.  
  60. #endif
  61.  
  62.  
  63.